<?php

// Category News Boxes
function get_exclude_categories($label) {
    
    $include = array();
    $counter = 0;
    $cats = get_categories('hide_empty=0');
    
    foreach ($cats as $cat) {
        
        $counter++;
        
        if ( get_option( $label.$cat->cat_ID ) == 'true') {
            
                $exclude[] = $cat->cat_ID;
            }
        }
        if(!empty($exclude)){
        $exclude = implode(',',$exclude);
        }
    return $exclude;

}

/*-----------------------------------------------------------------------------------*/
/* WordPress 3.0 New Features Support */
/*-----------------------------------------------------------------------------------*/

if ( function_exists('wp_nav_menu') ) {
	add_theme_support( 'nav-menus' );
	register_nav_menus( array( 'primary-menu' => __( 'Primary Menu' ) ) );
}

/*-----------------------------------------------------------------------------------*/
/* Featured Slider Settings */
/*-----------------------------------------------------------------------------------*/

add_filter('wp_head', 'woo_slider_options');

	function woo_slider_options() { 
		
		global $woo_options;
		
		if (is_home() && !is_paged()): 
		
			$slider_interval = get_option( 'woo_slider_interval' ) * 1000;
			$slider_speed = get_option( 'woo_slider_speed' ) * 1000;
			$effect = get_option( 'woo_slider_effect' );				
			
			// check interval is within range
			if ( $slider_interval < 500 || $slider_interval > 20000 )
				$slider_interval = 6000;
		
			// check speed is within range
			if ( $slider_speed > 5000 OR $slider_speed == '' )
				$slider_speed = 500;
		
			if ( $effect == '' )
				$effect = 'slide';
		?>
		
<!-- Woo Slider Settings -->
<script type="text/javascript">
	jQuery(window).load(function(){
		
		jQuery('#slides').slides({
			preload: true,
			preloadImage: '<?php echo get_template_directory_uri(); ?>/images/loading.png',
			autoHeight: false,
			effect: '<?php echo get_option( 'woo_slider_effect' ); ?>',
			container: 'slides_container',
			<?php if (get_option( 'woo_slider_random' ) == "true"): ?>			
			randomize: true,
			<?php endif; ?>
			<?php if (get_option( 'woo_slider_hover' ) == "true"): ?>			
			hoverPause: true,
			<?php endif; ?>
			<?php if (get_option( 'woo_slider_auto' ) == "true"): ?>
			play: <?php echo $slider_interval; ?>,
			<?php endif; ?>			
			slideSpeed: <?php echo $slider_speed; ?>,
			crossfade: false,
			generateNextPrev: false,
			generatePagination: false, 
			next: 'next-slide', 
			prev: 'prev-slide'
		});

	});
</script>
					
		<?php endif;
	
	}

/*-----------------------------------------------------------------------------------*/
/* END */
/*-----------------------------------------------------------------------------------*/
?>